#!/usr/bin/python
# -*- coding: utf-8 -*-
while True:

    n,x0=map(int,raw_input().split())
    ll=[]

    i=0
    res=-1
    while(i<n):
        ll.append(raw_input().split())
        i+=1
    #ll=map(int,ll)
    #print ll
    min0=0
    max0=0
    for i in range(n):

        if min0>min(ll[i]):min0=min(ll[i])
        if max0<max(ll[i]):max0=max(ll[i])
    res=min([abs()])